package com.dai.spec.common.enums;

/**
 * 课程状态
 */
public enum CourseStatus {
     OPEN("0","开放"),
    CLOSE("1","关闭"),
    FULL("2","已满");
    private final String code;
    private final String status;

    CourseStatus(String code,String status){
        this.code =code;
        this.status =status;
    }
    public String getCode()
    {
        return code;
    }

    public String getStatus()
    {
        return status;
    }

    public  static String getValueByCode(String code){
        for (CourseStatus courseStatusEnum : CourseStatus.values()) {
            if (courseStatusEnum.getCode().equals(code)){
                return courseStatusEnum.getStatus();
            }
        }
        return null;
    }
}
